<HTML>
<HEAD>
<?php 
require_once "dBConnect.php";
require_once 'Zend/Loader.php';
require_once "commonfuncs.php";
Zend_Loader::loadClass('Zend_Http_Client');
Zend_Loader::loadClass('Zend_Http_Client_Adapter_Socket');
Zend_Loader::loadClass('Zend_Gdata');
Zend_Loader::loadClass('Zend_Gdata_AuthSub');
//Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
Zend_Loader::loadClass('Zend_Gdata_Calendar');
//Zend_Loader::loadClass('Zend_Json');
Zend_Loader::loadClass('Zend_Gdata_App_CaptchaRequiredException');

include_once "inc.php"; 
session_start();

if (!isset($_SESSION['client'])) {
	header("location:index.php");
}

?>
<LINK rel="stylesheet" type="text/css" href="displayCalendar.css">
<LINK rel="stylesheet" type="text/css" href="js/plugins/ui.tabs.css">
<link rel="stylesheet" type="text/css" href="css/toggleElements.css" /> 

<SCRIPT type="text/javascript" src="js/ui/jquery.js"> </SCRIPT>
<SCRIPT type="text/javascript" src="js/plugins/jquery.curvycorners.packed.js"> </SCRIPT>
<SCRIPT type="text/javascript" src="js/plugins/ui.tabs.pack.js" ></script>
<script type="text/javascript" src="js/plugins/jquery.toggleElements.js"></script> 

<SCRIPT type="text/javascript">
	$(function(){
		$('.minical').corner({
			tl: {radius:10},
			tr:false,
			br:false,
			bl: {radius:10}
		});
		
		$('#c4 > ul').tabs({ fx: { opacity: 'toggle' } });
		
		    $('div.toggler-c').toggleElements( 
			{ fxAnimation:'slide', fxSpeed:'slow', className:'toggler' } ); 
			$('ul.toggler-c').toggleElements(); 
	});
	
	
</SCRIPT>


<?php
        include 'events.php';
	//Default: use time() to set $date to system time.
	$date = time();	
	if ($_GET['day']) {
		$current_day = $_GET['day'];
	}
	else {
		$current_day = date('d',$date);
	}
	if ($_GET['month'] && $_GET['year']) { 
		$month = $_GET['month'];
		$temp_stamp = mktime(0,0,0,$month,1,$year);
		$month_name = date('F',$temp_stamp);
		$year = $_GET['year'];
	}
	else {
		$month = date('m',$date);
		$month_name = date('F',$date);
		$year = date('Y', $date);
	}
?>

<TITLE>Team Calendar: View Month: <?php echo "$month_name $year"; ?></TITLE>
</HEAD>
<BODY onload="setup()">
<div id="fadewrapper">
<CENTER>
<TABLE border=0 cellspacing=0 cellpadding=0 height=100% width=94%>
<TR>
<TD width=150 valign=top>
	
	<img src="images/team_calendar_minilogo.jpg" alt="Team Calendar">
	<BR><BR>
	<div class="minical">
		<?php
			include 'printMiniCal.php';
		?>
	</div>
	
	<?php include 'calendarNavigation.php'; ?>
</TD>
<TD valign=top height=100%>
	<TABLE width=100%>
	<TR><TD align=left></TD>
	<TD align=right valign=bottom></TD></TR>
	</TABLE>
	
	<DIV id="c4">
	
		<UL>
			<LI><a href="#viewM"><span>View Month</span></LI>
			<LI><a href="#viewD"><span>View Day</span></LI>
			<LI><a href="#viewW"><span>View Week</span></LI>
		</UL>
	
		<DIV id="viewM">
			<?php 
				$month = $month;
				$year = $year;
				include 'printMonthHeader.php'; 
				include 'printMonth.php'; 
			?>
		</DIV>
		<DIV id="viewD">
			<?php 
				$day = $current_day;
				$month = $month;
				$year = $year;
				include 'printDayHeader.php';
				include 'printDay.php'; 
			?>
		</DIV>
		<DIV id="viewW">
			<?php 
				$day = $current_day;
				$month = $month;
				$year = $year;
				include 'printWeekHeader.php';
				include 'printWeek.php'; 
			?>
		</DIV>
	</DIV>
		
</TD>
</TR>
</TABLE>
</CENTER>
	<div id="editEvent" style="display:none">
		<?php
			include_once "editEvent.php";
		?>
	</div>

 
 
</div>
</BODY>
</HTML>
